#pragma once

#include <string>
#include <map>
#include <list>
using namespace std;

class CWord
{
public:
	CWord(void);
	CWord(const string& word, map<char, int>& keys, const string& keyId);
	CWord(const CWord* pWord);
	~CWord(void);
public: 
	static map<char, int> MakeKeys(const string& word);
	static string GetKeyId(const map<char, int> & keys);
	static map<char, int> Add(const map<char,int>& m1, const map<char,int>& m2);
	static bool IsSubSet(const map<char,int>& subM, const map<char, int> & goal);
public:
	const string GetKeyId() const;
	const map<char, int> GetKeys() const;
	const list<string> GetWordList() const;
	const string ToString() const;
	void AppendWord(const string& word);
	bool IsSubSet(const map<char,int>& m);
	bool IsEqualIfAdd(const map<char,int>& m, const map<char,int>& goal);
	void MergeWords(const list<string>& list1, const list<string> & list2);
	size_t GetMemoryUsage();
private:
	bool IsEqual(const map<char,int>& m1, const map<char,int>& m2);
private:
	string m_keyId;
	map<char, int> m_map;
	list<string> m_wordList;
};

